{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from tensorflow import keras\n",
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "data = keras.datasets.imdb\n",
    "max_word = 1000"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "(x_train,y_train),(x_test,y_test)=data.load_data(num_words=max_word)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "x_train = keras.preprocessing.sequence.pad_sequences(x_train,300)\n",
    "x_test = keras.preprocessing.sequence.pad_sequences(x_test,300)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "main_input = keras.Input(shape=(300,),)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "embedder = keras.layers.Embedding(10000,16,input_length=300)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "embed = embedder(main_input)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "cnn1 = keras.layers.Conv1D(32, 3,padding='same', strides=1, activation='relu')(embed)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "cnn1 = keras.layers.MaxPooling1D()(cnn1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "cnn2 = keras.layers.Conv1D(32, 4, padding='same',strides=1, activation='relu')(embed)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "cnn2 = keras.layers.MaxPooling1D()(cnn2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "cnn3 = keras.layers.Conv1D(32, 5, padding='same',strides=1, activation='relu')(embed)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "cnn3 = keras.layers.MaxPooling1D()(cnn3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "TensorShape([Dimension(None), Dimension(150), Dimension(32)])"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cnn3.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "cnn = keras.layers.concatenate([cnn1,cnn2,cnn3],axis=-1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "flat =keras.layers.Flatten()(cnn)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "drop =keras.layers.Dropout(0.5)(flat)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "main_output = keras.layers.Dense(1, activation='sigmoid',kernel_regularizer='l2')(drop)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "model = keras.Model(inputs=main_input, outputs=main_output)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "__________________________________________________________________________________________________\n",
      "Layer (type)                    Output Shape         Param #     Connected to                     \n",
      "==================================================================================================\n",
      "input_1 (InputLayer)            (None, 300)          0                                            \n",
      "__________________________________________________________________________________________________\n",
      "embedding (Embedding)           (None, 300, 16)      160000      input_1[0][0]                    \n",
      "__________________________________________________________________________________________________\n",
      "conv1d (Conv1D)                 (None, 300, 32)      1568        embedding[0][0]                  \n",
      "__________________________________________________________________________________________________\n",
      "conv1d_1 (Conv1D)               (None, 300, 32)      2080        embedding[0][0]                  \n",
      "__________________________________________________________________________________________________\n",
      "conv1d_2 (Conv1D)               (None, 300, 32)      2592        embedding[0][0]                  \n",
      "__________________________________________________________________________________________________\n",
      "max_pooling1d (MaxPooling1D)    (None, 150, 32)      0           conv1d[0][0]                     \n",
      "__________________________________________________________________________________________________\n",
      "max_pooling1d_1 (MaxPooling1D)  (None, 150, 32)      0           conv1d_1[0][0]                   \n",
      "__________________________________________________________________________________________________\n",
      "max_pooling1d_2 (MaxPooling1D)  (None, 150, 32)      0           conv1d_2[0][0]                   \n",
      "__________________________________________________________________________________________________\n",
      "concatenate (Concatenate)       (None, 150, 96)      0           max_pooling1d[0][0]              \n",
      "                                                                 max_pooling1d_1[0][0]            \n",
      "                                                                 max_pooling1d_2[0][0]            \n",
      "__________________________________________________________________________________________________\n",
      "flatten (Flatten)               (None, 14400)        0           concatenate[0][0]                \n",
      "__________________________________________________________________________________________________\n",
      "dropout (Dropout)               (None, 14400)        0           flatten[0][0]                    \n",
      "__________________________________________________________________________________________________\n",
      "dense (Dense)                   (None, 1)            14401       dropout[0][0]                    \n",
      "==================================================================================================\n",
      "Total params: 180,641\n",
      "Trainable params: 180,641\n",
      "Non-trainable params: 0\n",
      "__________________________________________________________________________________________________\n"
     ]
    }
   ],
   "source": [
    "model.summary()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "model.compile(optimizer='adam',loss='binary_crossentropy',metrics=['acc'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "E:\\Anacona3\\envs\\kr\\lib\\site-packages\\tensorflow\\python\\ops\\gradients_impl.py:112: UserWarning: Converting sparse IndexedSlices to a dense Tensor of unknown shape. This may consume a large amount of memory.\n",
      "  \"Converting sparse IndexedSlices to a dense Tensor of unknown shape. \"\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Train on 25000 samples, validate on 25000 samples\n",
      "Epoch 1/15\n",
      "25000/25000 [==============================] - 9s 360us/step - loss: 0.6537 - acc: 0.6100 - val_loss: 0.4774 - val_acc: 0.7977\n",
      "Epoch 2/15\n",
      "25000/25000 [==============================] - 5s 199us/step - loss: 0.3984 - acc: 0.8433 - val_loss: 0.3611 - val_acc: 0.8601\n",
      "Epoch 3/15\n",
      "25000/25000 [==============================] - 5s 199us/step - loss: 0.3479 - acc: 0.8662 - val_loss: 0.3449 - val_acc: 0.8634\n",
      "Epoch 4/15\n",
      "25000/25000 [==============================] - 5s 199us/step - loss: 0.3351 - acc: 0.8722 - val_loss: 0.3394 - val_acc: 0.8644\n",
      "Epoch 5/15\n",
      "25000/25000 [==============================] - 5s 198us/step - loss: 0.3277 - acc: 0.8746 - val_loss: 0.3372 - val_acc: 0.8662\n",
      "Epoch 6/15\n",
      "25000/25000 [==============================] - 5s 198us/step - loss: 0.3223 - acc: 0.8752 - val_loss: 0.3341 - val_acc: 0.8654\n",
      "Epoch 7/15\n",
      "25000/25000 [==============================] - 5s 199us/step - loss: 0.3175 - acc: 0.8764 - val_loss: 0.3369 - val_acc: 0.8648\n",
      "Epoch 8/15\n",
      "25000/25000 [==============================] - 5s 199us/step - loss: 0.3163 - acc: 0.8778 - val_loss: 0.3327 - val_acc: 0.8663\n",
      "Epoch 9/15\n",
      "25000/25000 [==============================] - 5s 199us/step - loss: 0.3116 - acc: 0.8794 - val_loss: 0.3324 - val_acc: 0.8659\n",
      "Epoch 10/15\n",
      "25000/25000 [==============================] - 5s 197us/step - loss: 0.3107 - acc: 0.8808 - val_loss: 0.3350 - val_acc: 0.8654\n",
      "Epoch 11/15\n",
      "25000/25000 [==============================] - 5s 197us/step - loss: 0.3106 - acc: 0.8788 - val_loss: 0.3286 - val_acc: 0.8676\n",
      "Epoch 12/15\n",
      "25000/25000 [==============================] - 5s 196us/step - loss: 0.3049 - acc: 0.8819 - val_loss: 0.3314 - val_acc: 0.8669\n",
      "Epoch 13/15\n",
      "25000/25000 [==============================] - 5s 197us/step - loss: 0.3037 - acc: 0.8840 - val_loss: 0.3294 - val_acc: 0.8673\n",
      "Epoch 14/15\n",
      "25000/25000 [==============================] - 5s 197us/step - loss: 0.3011 - acc: 0.8838 - val_loss: 0.3295 - val_acc: 0.8672\n",
      "Epoch 15/15\n",
      "25000/25000 [==============================] - 5s 197us/step - loss: 0.2986 - acc: 0.8850 - val_loss: 0.3277 - val_acc: 0.8688\n"
     ]
    }
   ],
   "source": [
    "history = model.fit(x_train,y_train,batch_size=256,epochs=15,shuffle=True,validation_data=(x_test,y_test))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x13744f18358>]"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX4AAAD8CAYAAABw1c+bAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHJ1JREFUeJzt3X1wXPV97/H31xKWbeEnjPyAZSNDiSnTCU8qbVIaSgnE\n3PKQZoYOD3koZMZhim9I08kFAnOnnQTKDcm93BaCr0uIyUCgJMDgMr52oGkCbeHWNjHxA3FwtTaW\nDNiO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C3gmTizgCboD4DPEVrP6/PLf0m6qBT5r8CTZvZL4DzgvoTrKSn/v5IfA28AGwi/j1V1\nl6mZPQW8Biw0s3Yz+yJwP3C5mb1N+F/L/UnWWFCm1oeAycBL+d+zpYkWGVGm3rF57+r+n4+IiFRa\nKlr8IiISn4JfRCRjFPwiIhmj4BcRyRgFv4hIxij4RUQyRsEvIpIxCn4RkYz5/z974LL5OW/hAAAA\nAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x13744f184e0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(history.epoch,history.history.get('acc'),c=\"r\",label=\"acc\")\n",
    "plt.plot(history.epoch,history.history.get('val_acc'),c=\"b\",label=\"val_acc\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python [conda env:kr]",
   "language": "python",
   "name": "conda-env-kr-py"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
